﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin-site.Master" AutoEventWireup="true" CodeBehind="ManageSponsors.aspx.cs" Inherits="CodeCamp12.admin.ManageSponsors" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" runat="server">
        <script src="../Scripts/ManageSponsors.js" type="text/javascript"></script>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="cphBody" runat="server">
    <div id="manageSponsors">
   
        <h2>Here you can manage the sponsors for the current CodeCamp event</h2>
        <a href="#" onclick="InsertSponsor();">Add new sponsor</a>
        <br />
        <br />
        <h3>Existing sponsors in database:</h3>
        <div id="SponsorsTemp">
        
        </div>
    </div>

    <div id="insertSponsor" class="popup-style">
    <form id="validateSponsor" method="get" action="">
        <table>
            <tr>
                <td class="style1">Sponsor name:</td>
                <td><input type="text" id="txtName" name="sponsorname"></td>
            </tr>
            <tr>
                <td class="style1">Sponsor type:</td>
                <td>
                    <select id="ddlTypes"></select>
                </td>
            </tr>
            <tr>
                <td class="style1">Sponsor image:</td>
                <td>
                    <div><label class="error" id="upload_img_error" style="display: none">Sponsor image is required</label></div>
                    <div id="upload_img">
                        <noscript>
                            <p>Please enable JavaScript to use file uploader.</p>
                            <!-- or put a simple form for upload here -->
                        </noscript>   
                    </div>
                </td>
            </tr>
            <tr>
                <td class="style1">Sponsor's website:</td>
                <td><input type="text" id="txtLink" name="sponsorlink"/></td>
            </tr>
        </table>
        <button type="button" id="btnInsert">Insert</button>
        <button type="button" id="btnCancel">Cancel</button>
    </form>
    </div>
    
    <script id="SponsorTemplate" type="text/x-jQuery-tmpl">
            <div class="SponsorDiv">
                <table>
                    <tr><td> <a href="http://${Link}">${SponsorName} </a></td><td rowspan="3"><img src="../GetImageForSponsor.ashx?id=${ID}" style="width: 150px; height: 70px;" /></td></tr>
                    <tr><td><label style="color:black; font-weight:bold; font-size:medium;">${SponsorType}</label></td></tr>
                    <tr><td> <button type="button" id="editBtn" onclick="UpdateSponsor('${ID}');">Edit</button><button type="submit" id="deleteBtn" onclick="DeleteSponsor('${ID}');">Delete</button> </td></tr>
                </table>
            </div>
        </script>
</asp:Content>
